﻿using System;
using System.Collections.Generic;

using System.Text;

namespace SQLDeployActions
{
    internal class DeployConstants
    {
        internal static string BaseSource, UserName, Password, ServerName, DBName, SQLSequenceFile, DMLFolderName;
        internal static bool IsTrustedConnection = false;
        internal const string SQLCMD_EXE = "SQLCMD.EXE";
        internal const string SERVER_OPTION = " -S ";
        internal const string DB_OPTION = " -d ";
        internal const string INPUT_FILE_OPTION = " -i ";
        internal const string USER_ID_OPTION = " -U ";
        internal const string PASSWORD_OPTION = " -P ";
        internal const string TRUSTED_CONNECTION_OPTION = " -E ";
        internal const string DDLFile = @".\DDLDeploy.sql";
        internal const string DMLFile = @".\DMLDeploy.sql";
        internal const string COMMENT_SYMBOL = "##";

        /*Messages*/
        internal const string MSG_UNDERLINE = @"**********************************************";
        internal const string MSG_ERROR_DETECTED = @"Error detected. Execution Halted!";
        internal const string MSG_EXECUTION_SUCCESS = @"Execution successful.";
        internal const string MSG_HEADING_STD_OUTPUT = @"Messages [ from SQL Interpreter]:";
        internal const string MSG_HEADING_STD_ERROR = @"Messages [from Host Application]:";
        internal const string MSG_SEQUENCE_FILE_EMPTY = @"Sequence file is empty! Exiting...";
        internal const string MSG_INSUFFICIENT_INFO = @"Insufficient Arguments!";
        //Cannot qualify this string as Const as we need to append NewLine.
        internal static string MSG_USAGE = @"Usage: SqlDeploy <ServerName> <DbName> [<SQLUserName> <SQLPassword>]" 
                                    + System.Environment.NewLine
                                    + " SQLUsername and SQLPassword are optional." 
                                    + " Omit to use trusted connection (Windows Authentication).";
        internal const string MSG_NO_SEQUENCE_FILE = @"SQL sequence file not found! Exiting...";
        internal const string MSG_SEQUENCE_EMPTY = @"Sequence file is empty! Exiting...";
        internal const string MSG_ABORT = @"Aborting...";
        internal const string MSG_CONNECTED = @" CONNECTED!";
        internal const string REGEX_ERRORLEVELMATCH = @", Level [1-2][1-9],";

    }
}
